<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>{$head[title]}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta content="{$head[keywords]}" name="keywords" />
<meta content="{$head[description]}" name="description" />
<base href="{SITE_URL}" />
<link href="favicon.ico" rel="shortcut icon" />
<link href="../skin/style.css" rel="stylesheet" type="text/css" />
<link href="{SKIN_PATH}modal.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="{$head[title]}" href="/rss.php?rssid={$catid}" />
<script language="JavaScript" src="misc/config.js"></script>
<script language="JavaScript" src="misc/jquery.min.js"></script>
<script language="JavaScript" src="misc/common.js"></script>
<script language="JavaScript" src="misc/validator.js"></script>

<script type="text/javascript" src="misc/validator.js"></script>
</head>
<body>

{template 'header.html'}

<div class="container">
	
    <div class="main">
    	
      	
        <div class="mod">
            <div class="head">修改密码</div>
            <div class="body">
                <form action="" method="post">
                <table cellpadding="0" cellspacing="0" class="table_form">
                    {if $SETTING[uc]}
                    <tr>
                        <th width="12%">用户名：</th>
                        <td width="21%">
                            <input type="text" name="name" id="name" require="true" datatype="limit" min="3" max="20" msg="用户名长度必须大于3小于20" />
                        </td>
                    </tr>
                    <tr>
                        <th width="12%">邮件：</th>
                        <td width="21%">
                            <input type="text" name="email" id="email"  />
                        </td>
                    </tr>
                    {/if}
                    <tr>
                        <th width="12%">新密码：</th>
                        <td width="21%">
                            <input type="password" name="password" id="password" require="true" datatype="limit" min="3" max="20" msg="密码长度必须大于3小于20" />
                        </td>
                    </tr>
                    
                    <tr>
                        <th>密码强度：</th>
                        <td>
                             <div id="pw_check_1" class="pw_check" style="display:none;"><span><strong class="c_orange">弱</strong></span><span>中</span><span>强</span></div>
                            <div id="pw_check_2" class="pw_check" style="display:none;"><span>弱</span><span><strong class="c_orange">中</strong></span><span>强</span></div>
                                <div id="pw_check_3" class="pw_check" style="display:none;"><span>弱</span><span>中</span><span><strong class="c_orange">强</strong></span></div></td>
                        </td>
                    </tr>
                    <tr>
                        <th>确认密码：</th>
                        <td>
                            <input type="password" id="pwdconfirm" name="pwdconfirm" require="true" datatype="repeat"  to="password" msg="两次输入的密码不一致" />
                        </td>
                    </tr>
                    <tr>
                    <th></th>
                    <td colspan="2">
                    <input type="hidden" name="authstr" value="{$authstr}" />
                    <input type="hidden" name="userid" value="{$userid}" />
                    <input type="submit" name="dosubmit" id="button" value="下一步" />
                     </td>
                  </tr>
                </table>
            </form>
            </div>
        </div> 
      
    </div>
    
    <div class="aside">
    	
    </div>
</div>




 
{template 'footer.html'}
<script language="javascript">
$().ready(function() {
	  $('form').checkForm(1);
	});

$('#password').blur(function(){
	ShowStrong();
 });

function CharMode(iN)
{
if (iN>=65 && iN <= 90)
return 2;
if (iN>=97 && iN <= 122)
return 4;
else
return 1;
}

function bitTotal(num)
{
modes = 0;
for(i=0; i<3; i++)
{
if (num & 1) modes++;
num >>>= 1;
}
return modes;
}

function checkStrong(sPW){
Modes=0;

for (i=0;i<sPW.length;i++){
//测试每一个字符的类别并统计一共有多少种模式.
Modes|=CharMode(sPW.charCodeAt(i));
}
var btotal = bitTotal(Modes);
if (sPW.length >= 10) btotal++;
switch(btotal) {
case 1:
return "pw_check_1";
break;
case 2:
return "pw_check_2";
break;
case 3:
return "pw_check_3";
break;
default:
return "pw_check_1";
}
}

function ShowStrong(){
data = checkStrong($('#password').val());
pw_id = '#' + data;
$(".pw_check").hide();
$(pw_id).show();
}

</script>